<template>
	<view >
		<!-- oinvodetail 发票详情 -->
		<view class="oicing_outer">
			
			<view class="total_box FlexColumn">
				<view class="price_box FlexBox">
					<view class="num">
						{{totalAmount}}
					</view>
					<view class="unit">
						元
					</view>
				</view>
				<view class="total_txt">
					发票总额
				</view>
			</view>
			
			<view class="oicing_tit">
				发票总数{{select_List.length}}张
			</view>
			<view class="oicing_content">
				<view class="Issue_line FlexBox">
					<view class="tit">
						发票内容
					</view>
					<view class="value">
						*运输服务*客运服务费
					</view>
				</view>
				<view class="Issue_line FlexBox">
					<view class="tit">
						开票方
					</view>
					<view class="value">
						口岸通程旅运有限公司
					</view>
				</view>
				<view class="Issue_line FlexBox">
					<view class="tit">
						发票总额
					</view>
					<view class="value">
						{{totalAmount}}
					</view>
				</view>
			</view>
			
			
			<view class="oicing_tit">
				订单信息
			</view>
			<view>
				<oderlist :datalist="select_List"></oderlist>
			</view>
			
		</view>
		
	</view>
</template>

<script>
	import oderlist from "./components/oderlist.vue"
	export default {
		components: {
			oderlist,
		},
		data(){
			return {
				select_List: [],
			} 
		},
		onLoad() {
			this.initialization()
		},
		computed:{
			totalAmount(){
				let num = 0
				for(let item of this.select_List) {
					if(item.order_amount) {
						num += item.order_amount * 1
					}
				}
				return num
			},
		},
		methods:{
			// 页面初始化
			initialization() {
				// 发票选择的列表
				let selectList = uni.getStorageSync('invoic_select_list')
				if(selectList && typeof(selectList) == 'string') {
					this.select_List = JSON.parse(selectList)
				}
			},
		},
	}
</script>

<style lang="scss" scoped>
	@import "@/bundle4/css/Flex.scss";
	@import "./css/oinvo.scss";
	.oicing_outer{
		padding: 20rpx;
		.oicing_content{
			padding: 40rpx 38rpx;
		}
	}
	.total_box {
		
		width: 100%;
		height: 222rpx;
		border-radius: 10rpx;
		background: #FFFFFF;
		.price_box{
			.num{
				font-size: 68rpx;
				font-weight: 700;
				color: rgba(38, 38, 38, 1);
				text-align: center;
			}
			.unit{
				
				font-size: 28rpx;
				font-weight: 400;
				color: rgba(38, 38, 38, 1);
				text-align: center;
				margin-top: 29rpx;
			}
		}
		.total_txt{
			margin-top: 4rpx;
			font-size: 26rpx;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
			text-align: center;

		}
	}   
</style>